<template>
  <div class="session-wrap">
    <el-table border :data="tableData">
      <el-table-column label="名称" align="center">
        <template slot-scope="scope">
          <el-input v-model="scope.row.name" placeholder="添加名称" />
        </template>
      </el-table-column>
      <el-table-column label="链接" align="center">
        <template slot-scope="scope">
          <el-input v-model="scope.row.url" placeholder="添加链接地址" />
        </template>
      </el-table-column>
      <el-table-column label="删除" align="center">
        <template slot-scope="scope">
          <el-button size="mini" type="danger" @click="handleDelete(scope.$index)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  props: {
    pcTableAddTitle: {
      type: String,
      default: ""
    },
    tableData: {
      type: Array,
      default: () => {
        return [];
      }
    }
  },
  data() {
    return {
      name: "",
      url: "",
    };
  },
  methods: {
    //删除列表中的数据
    handleDelete(index) {
        debugger;
      this.tableData.splice(index, 1);
    },
  }
};
</script>
<style lang="scss" scoped>
.session-wrap {
  .el-table {
    margin-bottom: 30px;
  }
}
</style>
